1. Field of the Invention
Embodiments of the present invention generally relate to computer graphics, and more particularly to processing vertices with a w coordinate of 0.
2. Description of the Related Art
Conventional graphics processors are exemplified by systems and methods developed to process graphics primitives defined by vertices that are represented in homogeneous coordinates. Vertices in object space, represented by coordinates (X,Y,Z) are converted into homogeneous space by applying a projection transform, resulting in a vertex represented by coordinates (xh,yh,zh,w). A perspective transform is applied to simulate a scene observed from a specific position and viewed in a specific direction. The graphics primitives are clipped to a viewing frustum in homogeneous space. Clipping is easier to perform and has better precision characteristics when it is performed in homogeneous space.
FIG. 1 illustrates a graphics primitive 100 in homogeneous space with a viewpoint, eye 120 defining a viewing region 110. Graphics primitives and portions of graphics primitives lying outside of the viewing region 110 will not be visible in an image produced from eye 120's perspective since they will be clipped by one or more of the six faces of the viewing frustum. A w>0 region lies in front (to the right in FIG. 1) of eye 120 and a w<0 region lies behind (to the left) of eye 120. A vertex 101 has a w coordinate value of zero.
After the vertices have been processed in homogeneous space they are projected into non-homogeneous space, normalized device coordinate space, by dividing each vertex coordinate by w, to produce projected coordinates (xn,yn,zn) ranging in value from −1 to 1, inclusive. When a vertex has a w coordinate of zero, division by w results in a singularity, producing an infinite vertex that may cause a visual artifact.
Accordingly, there is a desire to process vertices with a w coordinate equal to zero in a robust manner that does not introduce visual artifacts.